package org.trinity.netdisk.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.trinity.netdisk.enums.ShareDays;

import java.util.Date;

public class ShareFile {
    private Long id;

    /**
    * 分享人
    */
    private Long shareUserId;

    /**
    * 分享的文件
    */
    private Long shareUserFileId;

    /**
    * 开始分享的时间
    */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date shareStartTime;

    /**
    * 分享的时长 
    */
    private ShareDays shareDays;

    /**
    * 四位验证码
    */
    private String checkNum;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getShareUserId() {
        return shareUserId;
    }

    public void setShareUserId(Long shareUserId) {
        this.shareUserId = shareUserId;
    }

    public Long getShareUserFileId() {
        return shareUserFileId;
    }

    public void setShareUserFileId(Long shareUserFileId) {
        this.shareUserFileId = shareUserFileId;
    }

    public Date getShareStartTime() {
        return shareStartTime;
    }

    public void setShareStartTime(Date shareStartTime) {
        this.shareStartTime = shareStartTime;
    }

    public ShareDays getShareDays() {
        return shareDays;
    }

    public void setShareDays(ShareDays shareDays) {
        this.shareDays = shareDays;
    }

    public String getCheckNum() {
        return checkNum;
    }

    public void setCheckNum(String checkNum) {
        this.checkNum = checkNum;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", shareUserId=").append(shareUserId);
        sb.append(", shareUserFileId=").append(shareUserFileId);
        sb.append(", shareStartTime=").append(shareStartTime);
        sb.append(", shareDays=").append(shareDays);
        sb.append(", checkNum=").append(checkNum);
        sb.append("]");
        return sb.toString();
    }
}